<?php include( "templates/include/header.php" );
  include( "templates/include/adminHeader.php" );?>
  
      <div id="adminHeader">
        <h2>Administation de la page d'Accueil</h2>
        <p>Vous &ecirc;tes connect&eacute; en tant que <b><?php echo htmlspecialchars( $_SESSION['username']) ?></b>. <a href="admin.php?action=logout"?>Se D&eacute;connecter</a></p>
      </div>
 
      <h1>Tous les Arcticles</h1>
 
<?php if ( isset( $results['errorMessage'] ) ) { ?>
        <div class="errorMessage"><?php echo $results['errorMessage'] ?></div>
<?php } ?>
 
 
<?php if ( isset( $results['statusMessage'] ) ) { ?>
        <div class="statusMessage"><?php echo $results['statusMessage'] ?></div>
<?php } ?>

<?php foreach ( $results['home'] as $home ) { ?>
  <table align="center" width="90%" cellpadding="5px" cellspacing="0" border="0">
  	<tr onclick="location='admin.php?action=editHome&amp;homeId=<?php echo $home->id?>'" height="230px">
        <td width="300px" valign="top" style="margin:0;padding:0" align="left">
          <div class="CycleFade1" align="left" style="margin:0;padding:0;width:300px;height:200px">
            <?php
              $list = array();
              $list = $home->getImages();
              foreach( $list['results'] as $image ) { ?>
                <img class="InfosBoxL"  src="<?php echo $image['image'] ?>" width="300px" height="200px"/>
              <?php } ?>
          </div>
          <p><a href="admin.php?action=editHomeImages&amp;homeId=<?php echo $home->id ?>">Modifier les Images</a></p>
        </td>
      <td valign="middle" align="justify">
        <?php echo $home->content ?>
      </td>
    </tr>
  </table>
<?php } ?>

      <p><?php echo $results['totalRows']?> article<?php echo ( $results['totalRows'] != 1 ) ? 's' : '' ?> au total.</p>
 
      <p><a href="admin.php?action=newHome">Ajouter un Article</a></p>
 
<?php 
  include( "templates/include/adminFooter.php" );
  include( "templates/include/footer.php" ); ?>
